package org.rupa.core.config;

import org.rupa.common.model.RegistryCenterInfo;
import org.rupa.core.poll.PollFactory;
import org.rupa.core.poll.impl.RandomPollFactory;
import org.rupa.core.registry.center.RegistryCenter;
import org.rupa.core.registry.center.controller.RegistryCenterController;
import org.rupa.core.registry.center.zk.ZkRegistryCenter;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.core.annotation.Order;

@SpringBootConfiguration
public class RegistryCenterConfig {
    @Bean
    public RegistryCenter registryCenter() {
        return new ZkRegistryCenter();
    }

    @Bean
    public RegistryCenterInfo registryCenterInfo() {
        return new RegistryCenterInfo();
    }

    @Bean
    public RegistryCenterController registryCenterController() {
        return new RegistryCenterController();
    }

    @Bean
    public PollFactory pollFactory() {
        return new RandomPollFactory();
    }
}
